<?php
	include_once "conf/conf.site.inc.php";
	include_once BDD_CLASS;
	include_once FUNCTIONS_FILE;
	
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<meta name="description" content="" />

<link href="css/style.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css/forms.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css/search.css" rel="stylesheet" type="text/css" media="screen" />

<script type="text/javascript" src="js/jquery/js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="js/search.js"></script>
<script type="text/javascript" src="js/inscription.js"></script>
<script type="text/javascript" src="js/jquery.bpopup.min.js"></script>

<script type="text/javascript" >
	$(document).ready(function() {
		$("#btnNewParent").click(function() {
			$('#createParent').bPopup({
				//contentContainer:'.content',
				loadUrl: 'forms/createParent.html' //Uses jQuery.load()
			});
		});
	});
</script>

<center>
	<title>
		<?php echo NOM_SITE ?>
	</title>
</center>

<?php	
	if ((!isset($_SESSION["LOGIN"]) && $_SESSION["LOGIN"] == "")  && (!isset($_POST["login"]) && $_POST["login"] == "")) {
		redirect ("connexion.php");
		return false;
	}
	connexion ();
	if (!isset($db) && $db == NULL) {
		return 0;
	}
	
	if (isset($_POST["login"]) && $_POST["login"] != "") {
		$reqGetUser = "SELECT * FROM ".DATA_BASE.".".ARABE_USER." WHERE LOGIN = '".$_POST["login"]."' AND PASSWORD = '".$_POST["password"]."' LIMIT 1;";
		$result = $db->MysqlSelectPerso($reqGetUser);
		if (count($result) > 0) {
			$_SESSION["LOGIN"] = $result[0]["LOGIN"];
			$_SESSION["ID_USER"] = $result[0]["ID_USER"];
			$_SESSION["CONNEXION_TIME"] = time();
		}
		else {
			redirect ("connexion.php?badlogin=1");
			return false;
		}
	}
?>
<!--[if IE]>
<style type="text/css">
#sidebar #calendar {
	background-position: 0px 20px;
}
</style>
<![endif]-->
</head>
<body>
<div id="logo">
	<h1><a href="#"><?php echo NOM_SITE ?></a></h1>
</div>
<div id="menu">
	<ul>
		<li class="first"><a href="index.php" accesskey="1" title="">Acceuil</a></li>
		<?php if (isset($_SESSION["LOGIN"]) && $_SESSION["LOGIN"] != "") {echo '<li><a href="eleve_inscription.php" accesskey="2" title="">Inscrir son Enfant</a></li>';}?>
		<?php if (isset($_SESSION["LOGIN"]) && $_SESSION["LOGIN"] != "") {echo '<li><a href="logout.php" accesskey="6" title="">D&eacute;connexion</a></li>';}?>
	</ul>
</div>
<hr />
<div id="banner"><img src="images/img04.jpg" alt="" width="960" height="147" /></div>
<!-- start page -->
<div id="page">
	<!-- start content -->
	<div id="content">
		<div class="post">
			<div class="search_form_div">
				<input type="text" class="input_text" name="parentSearchInput" id="parentSearchInput" />
				<input type="image" class ="searchButton" id="parentSearch" name="parentSearch" src="images/Search_icon.png" />
				<span class="loading" id="loading">&nbsp;</span>
			</div>
			<div class="searchResult" id="searchResult">
			
			</div>
			<div>
				<a id="btnNewParent">Nouveau Parent<a/>
			</div>
		</div>
	</div>
	<!-- end content -->
	<!-- start sidebar -->
	<div id="sidebar">
		<div id="fraisInscriptionSearch" class="fraisInscriptionSearch">
			<div class="title_insc">Frais D'inscription</div>
                        <div class="form_frais_insc">
                            <form method="POST" id="form_frais_inscription">
                                <div class="form_container" id="form_container">
                                    <div class="form_contents">
                                        <div class="text">
                                            <span class="element_payement_label" class="label_paiment">
						Montant Total &agrave; Payer
                                            </span>
                                            <span id="span_montant_total">
						<input type="text" class="input_paiment" name="montant_total" id="montant_total" />
                                            </span>
                                        </div>

                                        <div class="text">
                                             <span class="element_payement_label">Restant &agrave; Payer :</span>
                                             <span id="restant_a_payer"></span>
                                        </div>

                                        <div class="paiement">
                                            <div>
                                                <label id="payement_label" id="payement_label">
                                                    <span class="element_payement_label">
                                                        Montant
                                                    </span>
                                                </label>
                                                <input type="text" value="" class="input_paiment" name="montant_a_payer" id="montant_a_payer" />
                                            </div>
											
											<div>
                                                <label id="payement_label" id="payement_label">
                                                    <span class="element_payement_label">
                                                        Paimenent Par
                                                    </span>
                                                </label>
                                                <select name="type_paiment" id="type_paiment">
                                                    <option value="CHEQUE">Cheque</option>
                                                    <option value="ESPECE">Espece</option>
                                                </select>
                                            </div>

                                            <div class="form_element_container" id="submit_btn">
                                                <div class="form_contents" id="form_container">
                                                    <input type="hidden" name="action" id="ation_paiement" value="" />
                                                    <input type="hidden" name="id_frais_inscription" id="id_frais_inscription" value="" />
                                                    <input type="hidden" name="id_parent_frais" id="id_parent_frais" value="" />
                                                    <input type="button" class="payer"  name="payer" id="payer" value="Payer" />
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
		</div>
	</div>
	<!-- end sidebar -->
</div>

<div id="createParent" class="newFormPopUp"></div>
<div id="createEleve" class="newFormPopUp"></div>
<!-- end page -->
<div id="footer">
	<p class="legal"><?php echo FOOTER ?></p>
</div>
</body>
</html>
